﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Garlic.CC.BaseClass;
using Garlic.CC.Utility;
using Garlic.BLL.Common;
using Garlic.DM.DataModel;
using Garlic.CC.WebUtility;
using Garlic.BLL;

public partial class SystemManagement_SysConfigEdit : BasePage
{
    

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string parameter_name = Request.QueryString["parameter_name"];

            if (!(string.IsNullOrEmpty(parameter_name)))
            {
                this.formSysConfig.DefaultMode = FormViewMode.Edit;
            }
            else
            {
                this.ShowMessage("页面需要参数名信息！");
                //this.Response.Write("<script language=javascript>window.close();</script>"); 
            }
        }
    }

    private void ShowMessage(string msg)
    {
        this.Message = msg;
    }

    protected void TopToolBar_OnClick(object sender, Garlic.UI.Components.IconButtonClickEventArgs args)
    {
            switch (args.Command)
            {
                case ToolbarCommand.Save:
                    this.formSysConfig.UpdateItem(true);
                    //如果没有出异常，说明插入成功
                    //立即关闭当前窗口
                    this.CloseVirtualWindow(true);
                    break;
            }
    }
}
